var friendSvc = require("../../services/friendSvc");
//乐友首页
exports.index = function (req, res) {
    res.render("friend/index");
};
//乐友列表
exports.friendsList = function (req, res) {
    res.render("friend/friendsList");
};
//好友列表
exports.getFriendList = function (req, res) {
    friendSvc.getFriendList(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//圈子列表
exports.circleList = function (req, res) {
    res.render("friend/circleList");
};
//获取圈子列表
exports.getCircleList = function (req, res) {
    friendSvc.getCircleList(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//好友动态列表
exports.getFriendDynamic = function (req, res) {
    friendSvc.getFriendDynamic(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//动态列表
exports.dynamicList = function (req, res) {
    res.render("friend/dynamicList");
};
//聊天页面
exports.chatPage = function (req, res) {
    res.render("friend/chatPage");
};
//圈子贴吧
exports.circleBar = function (req, res) {
    res.render("friend/circleBar");
};
//圈子详情
exports.circleInfo = function (req, res) {
    res.render("friend/circleInfo");
};
//通过圈子id 获取圈子信息
exports.getGroupInfo = function (req, res) {
    friendSvc.getGroupInfo(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//通过用户id 加入圈子
exports.joinGroup = function (req, res) {
    friendSvc.joinGroup(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//圈子广场
exports.circleSquare = function (req, res) {
    res.render("friend/circleSquare");
};
//乐友-圈子广场-圈子分类列表
exports.circleCategory = function (req, res) {
    friendSvc.circleCategory(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-圈子广场-分类圈子列表
exports.circleCategoryList = function (req, res) {
    friendSvc.circleCategoryList(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//圈子成员
exports.circleMember = function (req, res) {
    res.render("friend/circleMember");
};
//乐友-获取圈子成员信息
exports.getGroupMemberInfo = function (req, res) {
    friendSvc.getGroupMemberInfo(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-修改圈子提醒
exports.updateGroupRemind = function (req, res) {
    friendSvc.updateGroupRemind(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//圈子设置
exports.circleSetup = function (req, res) {
    res.render("friend/circleSetup");
};
//乐友-解散圈子
exports.dismissGroup = function (req, res) {
    friendSvc.dismissGroup(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-踢出圈子
exports.kickOutGroup = function (req, res) {
    friendSvc.kickOutGroup(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//圈子简介编辑
exports.abstractEdit = function (req, res) {
    res.render("friend/abstractEdit");
};
//乐友-修改圈子简介
exports.updateGroupIntroduction = function (req, res) {
    friendSvc.updateGroupIntroduction(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//圈子商品
exports.circleProducts = function (req, res) {
    res.render("friend/circleProducts");
};
//更改频道
exports.changeChannel = function (req, res) {
    res.render("friend/changeChannel");
};
//乐友-修改所属频道
exports.updateGroupCategory = function (req, res) {
    friendSvc.updateGroupCategory(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//帖子详情
exports.postDetails = function (req, res) {
    res.render("friend/postDetails");
};
//乐友-帖子详情
exports.getPost= function (req, res) {
    friendSvc.getPost(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-帖子-评论列表
exports.getInfoPostCommentList= function (req, res) {
    friendSvc.getInfoPostCommentList(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-帖子-获取评论回复列表
exports.getInfoPostCommentReplyList= function (req, res) {
    friendSvc.getInfoPostCommentReplyList(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-帖子-评论点赞
exports.praisePostComment= function (req, res) {
    friendSvc.praisePostComment(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-帖子-发表评论
exports.postComment= function (req, res) {
    friendSvc.postComment(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-帖子-获取评论详情
exports.getInfoPostCommentByCommentId= function (req, res) {
    friendSvc.getInfoPostCommentByCommentId(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-设置精选
exports.setSelected= function (req, res) {
    friendSvc.setSelected(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-设置置顶
exports.setTop= function (req, res) {
    friendSvc.setTop(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-设置公告
exports.setNotice= function (req, res) {
    friendSvc.setNotice(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-点赞
exports.praisePost= function (req, res) {
    friendSvc.praisePost(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//建立新圈子
exports.foundCircle = function (req, res) {
    res.render("friend/foundCircle");
};
//乐友-创建圈子
exports.createGroup= function (req, res) {
    friendSvc.createGroup(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//发布帖子
exports.releasePost = function (req, res) {
    res.render("friend/releasePost");
};
//乐友-发布帖子
exports.savePost= function (req, res) {
    friendSvc.savePost(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-退圈子
exports.quitGroup= function (req, res) {
    friendSvc.quitGroup(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-修改圈子验证方式
exports.updateGroupValidate= function (req, res) {
    friendSvc.updateGroupValidate(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-修改成员数量上线
exports.modifyNumber = function (req, res) {
    res.render("friend/modifyNumber");
};
//乐友-个人商品列表
exports.getProductList= function (req, res) {
    friendSvc.getProductList(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-购买展位
exports.buyBooth= function (req, res) {
    friendSvc.buyBooth(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-增加圈子商品
exports.addCircleProduct= function (req, res) {
    friendSvc.addCircleProduct(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-删除圈子商品
exports.deleteCircleProduct= function (req, res) {
    friendSvc.deleteCircleProduct(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-我的帖子
exports.myPost = function (req, res) {
    res.render("friend/myPost");
};
//乐友-我的帖子
exports.myPosts= function (req, res) {
    friendSvc.myPosts(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-我的回帖
exports.myRepliesPosts= function (req, res) {
    friendSvc.myRepliesPosts(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-删除帖子
exports.deletePost= function (req, res) {
    friendSvc.deletePost(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-帖子回收站
exports.postRecycling = function (req, res) {
    res.render("friend/postRecycling");
};
//乐友-我的回收站帖子
exports.myDelPosts= function (req, res) {
    friendSvc.myDelPosts(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-圈子通知
exports.circleNotice = function (req, res) {
    res.render("friend/circleNotice");
};
//乐友-我的点赞
exports.myPraiseForward = function (req, res) {
    res.render("friend/myPraiseForward");
};
//乐友-我的帖子转发通知
exports.myForwardPost = function (req, res) {
    friendSvc.myForwardPost(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-我的帖子点赞通知
exports.myPraisePost = function (req, res) {
    friendSvc.myPraisePost(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-聊天设置
exports.chatSettings = function (req, res) {
    res.render("friend/chatSettings");
};
//乐友-选择列表
exports.choiceList = function (req, res) {
    res.render("friend/choiceList");
};
//获取用户关系
exports.getUserRelationship = function (req, res) {
    friendSvc.getUserRelationship(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-选择列表
exports.searchPage = function (req, res) {
    res.render("friend/searchPage");
};
//乐友-搜索
exports.search = function (req, res) {
    friendSvc.search(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-搜索好友
exports.searchfriendList = function (req, res) {
    friendSvc.searchfriendList(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-搜索圈子
exports.searchcircleList = function (req, res) {
    friendSvc.searchcircleList(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-搜索未加入圈子
exports.searchcirclenotinList = function (req, res) {
    friendSvc.searchcirclenotinList(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-转发帖子
exports.forward = function (req, res) {
    res.render("friend/forward");
};
//乐友-转发帖子
exports.forwardResult = function (req, res) {
    res.render("friend/forwardResult");
};
//乐友-帖子分享
exports.forwardPost = function (req, res) {
    friendSvc.forwardPost(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-帖子列表
exports.getCirclePost = function (req, res) {
    friendSvc.getCirclePost(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};
//乐友-添加好友
exports.addFriend = function (req, res) {
    res.render("friend/addFriend");
};
//乐友-添加好友
exports.getAddFriend = function (req, res) {
    friendSvc.getAddFriend(req.body, null, function (b) {
        if (b.error || b.json.code !== 200) {
            res.send(b.json);
        } else {
            res.send(b.body);
        }
    });
};